package com.zhongkun.datahome.service.res;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.zhongkun.datahome.service.domain.CommonFile;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * @Author: lifengsheng
 * @Date: 2025/4/15 15:08
 * @Desc
 */
@Data
public class CommonFileVo {
    @ApiModelProperty("主键")
    private Long id;

    @ApiModelProperty("文件类型")
    private String fileType;

    @ApiModelProperty("文件url")
    private String fileUrl;

    @ApiModelProperty("文件大小")
    private String fileSize;

    @ApiModelProperty("文件名称")
    private String fileName;

    @ApiModelProperty("文件备注")
    private String remark;

    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @ApiModelProperty("更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    public static CommonFileVo convert(CommonFile commonFile) {
        CommonFileVo commonFileVo = new CommonFileVo();
        commonFileVo.setId(commonFile.getId());
        commonFileVo.setFileType(commonFile.getFileType());
        commonFileVo.setFileUrl(commonFile.getFileUrl());
        commonFileVo.setFileSize(commonFile.getFileSize());
        commonFileVo.setFileName(commonFile.getFileName());
        commonFileVo.setRemark(commonFile.getRemark());
        commonFileVo.setCreateTime(commonFile.getCreateTime());
        commonFileVo.setUpdateTime(commonFile.getUpdateTime());
        return commonFileVo;
    }
}
